package com.example.htmlspringtest.web.controller;

import com.example.htmlspringtest.entity.oTestCompany;
import com.example.htmlspringtest.entity.oTestIndustrytype;
import com.example.htmlspringtest.entity.oTestMechatype;
import com.example.htmlspringtest.entity.oTestMenu;
import com.example.htmlspringtest.service.IsCompanyService;
import com.example.htmlspringtest.service.IsIndustryService;
import com.example.htmlspringtest.service.IsMechaService;
import com.example.htmlspringtest.service.IsMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 *
 * @belongsProject: HTML-Spring-test
 * @belongsPackage: com.example.htmlspringtest.web.controller
 * @author: dongmufengchun
 * @createTime: 2022-06-19  20:08
 * @description: 各个实体类的接口
 * @version: 1.0
 */

@RequestMapping
@Controller
public class TListController {

    @Autowired
    private IsMenuService isMenuService;

    @Autowired
    private IsIndustryService isIndustryService;

    @Autowired
    private IsCompanyService isCompanyService;

    @Autowired
    private IsMechaService isMechaService;


    /**
     * 功能简介: 查询
     *
     * @return java.util.List<com.example.htmlspringtest.entity.oTestMenu>
     * @Author dongmufengchun
     * @Date 21:04 2022/6/19
     **/
    @RequestMapping("menu/list")
    @ResponseBody
    public List<oTestMenu> menuList(ModelMap map) {
        List<oTestMenu> list = isMenuService.findList();
        map.put("MenuList",list);
        return list;
    }

    @RequestMapping("industry/list")
    @ResponseBody
    public List<oTestIndustrytype> industryList(ModelMap map){
        List<oTestIndustrytype> list = isIndustryService.findList();
        map.put("IndustryList",list);
        return list;
    }

    @RequestMapping("company/list")
    @ResponseBody
    public List<oTestCompany> companyList(ModelMap map){
        List<oTestCompany> list = isCompanyService.findList();
        map.put("CompanyList",list);
        return list;
    }

    @RequestMapping("mecha/list")
    @ResponseBody
    public List<oTestMechatype> mechaList(ModelMap map){
        List<oTestMechatype> list = isMechaService.findList();
        map.put("MechatList",list);
        return list;
    }
}

